module.exports = app => {
  //引用mongoose
  const mongoose = require("mongoose");
  // 连接mongodb://127.0.0.1:27017
  mongoose.connect(
    "mongodb://localhost:27017/esports",
    {
      // 连接参数
      useNewUrlParser: true,
      useUnifiedTopology: true,
    },
    function (err) {
      if (err) {
        console.log("连接失败");
      } else {
        console.log("连接成功");
      }
    }
  );
};
